using System;

namespace Phoenix.Utilities
{
    internal static class SuffixHelper
    {
        public static string RemoveViewSuffixes(string name)
        {
            if (name.EndsWith("View"))
                return name.Substring(0, name.Length - 4);
            if (name.EndsWith("Page"))
                return name.Substring(0, name.Length - 4);
            if (name.EndsWith("Dialog"))
                return name.Substring(0, name.Length - 6);
            if (name.EndsWith("Dialogue"))
                return name.Substring(0, name.Length - 8);

            return name;
        }

        public static string RemoveControllerSuffixes(string name)
        {
            if (name.EndsWith("Controller"))
                return name.Substring(0, name.Length - 10);
            return name;
        }
    }
}